//
//  ALLog.h
//  ios-loan-assistant
//
//  Created by hcs on 2018/9/7.
//  Copyright © 2018年 guoqingping. All rights reserved.
//

#ifndef ALLog_h
#define ALLog_h

#import "ALLogManager.h"
#define LogSetOff [ALLogManager setLogLevel:LogLevelOff]
#define LogSetError [ALLogManager setLogLevel:LogLevelError]
#define LogSetWarning [ALLogManager setLogLevel:LogLevelWarning]
#define LogSetInfo [ALLogManager setLogLevel:LogLevelInfo]
#define LogSetDebug [ALLogManager setLogLevel:LogLevelDebug]
#define LogSetVerbose [ALLogManager setLogLevel:LogLevelVerbose]

#define DefineLog(level, fmt, ...) [ALLogManager logFlag:level \
file:__FILE__ \
format:fmt, ##__VA_ARGS__]

#if DEBUG
#define LogE(fmt, ...) DefineLog(LogFlagError, fmt, ##__VA_ARGS__)
#define LogW(fmt, ...) DefineLog(LogFlagWarning, fmt, ##__VA_ARGS__)
#define LogI(fmt, ...) DefineLog(LogFlagInfo, fmt, ##__VA_ARGS__)
#define LogD(fmt, ...) DefineLog(LogFlagDebug, fmt, ##__VA_ARGS__)
#define LogV(fmt, ...) DefineLog(LogFlagVerbose, fmt, ##__VA_ARGS__)
#else
#define LogE(fmt, ...)
#define LogW(fmt, ...)
#define LogI(fmt, ...)
#define LogD(fmt, ...)
#define LogV(fmt, ...)
#endif

#endif /* ALLog_h */
